package fr.cephb.operonj.core.db.binding;

import com.sleepycat.bind.tuple.TupleBinding;
import com.sleepycat.bind.tuple.TupleInput;
import com.sleepycat.bind.tuple.TupleOutput;

import fr.cephb.operonj.core.bio.ChromRange;

public class ChromRangeBinding extends TupleBinding<ChromRange>
	{
	@Override
	public ChromRange entryToObject(TupleInput input)
		{
		return new ChromRange(
			input.readInt(),
			input.readInt(),
			input.readInt()
			);
		}

	@Override
	public void objectToEntry(ChromRange c, TupleOutput output)
		{
		output.writeInt(c.getChromId());
		output.writeInt(c.getStart());
		output.writeInt(c.getEnd());
		}

	}
